package kuonjisai.swing.component;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

public class J14_BorderLayout extends JFrame {

	public J14_BorderLayout() {
		
			setDefaultLookAndFeelDecorated(true);
			setTitle( "BorderLayout - 5개 구역에 나눠서 배치");
			setLayout(new BorderLayout( 7, 7 ) );
			setBounds(300, 300, 450, 300);
			
			JButton btn1 = new JButton( "버튼 1 ");
			add( btn1, BorderLayout.NORTH );
			
			JButton btn2 = new JButton( "버튼 2 ");
			add( btn2, BorderLayout.SOUTH );
		
			JButton btn3 = new JButton( "버튼 3 ");
			add( btn3, BorderLayout.WEST );
			
			JButton btn4 = new JButton( "버튼 4 ");
			add( btn4, BorderLayout.EAST );
			
			JPanel panel = new JPanel();
						
			JButton pbtn1 = new JButton( "센터 버튼 1");
			panel.add( pbtn1 );
			JButton pbtn2 = new JButton( "센터 버튼 2");
			panel.add( pbtn2 );
			JButton pbtn3 = new JButton( "센터 버튼 3");
			panel.add( pbtn3 );
			JButton pbtn4 = new JButton( "센터 버튼 4");
			panel.add( pbtn4 );
			JButton pbtn5 = new JButton( "센터 버튼 5");
			panel.add( pbtn5 );
			
			add( panel, BorderLayout.CENTER );
			
			setVisible(true);
			
	}
	
	public static void main( String[] args){
		SwingUtilities.invokeLater( new Runnable() {
		@Override	public void run() {
				new J14_BorderLayout();		
				
			}
		});
		
		
		
		
		
	} // masn
	
	
} // class
